using System.Collections.Generic;
using System.Threading.Tasks;

namespace Admin.NET.Application.Util;

public interface IAggrementPlugin
{
	/// <summary>
	/// 启动
	/// </summary>
	(bool success, string msg) Start(string @params);

	/// <summary>
	/// 停止
	/// </summary>
	(bool success, string msg) Stop();

	/// <summary>
	/// 是否正在运行
	/// </summary>
	/// <returns></returns>
	bool IsRunning();

	/// <summary>
	/// 透传
	/// </summary>
	/// <param name="imei">序列号</param>
	/// <param name="valueCmd">自定义指令</param>
	/// <returns></returns>
	Task<string> Transform(string imei, string valueCmd);

	/// <summary>
	/// 打开继电器，断闸
	/// </summary>
	/// <returns></returns>
	bool PowerOff(string sn, string addr, string code, string baseCmd);

	/// <summary>
	/// 关闭继电器，断闸
	/// </summary>
	/// <param name="sn"></param>
	/// <param name="addr"></param>
	/// <returns></returns>
	bool PowerOn(string sn, string addr, string code, string baseCmd);

	/// <summary>
	/// 读取组合有功数据块电能
	/// </summary>
	/// <param name="sn"></param>
	/// <param name="addr"></param>
	/// <returns></returns>
	string ReadCombinedAllTotal(string sn, string addr, string code);

	/// <summary>
	/// 读取组合有功总电能
	/// </summary>
	/// <param name="sn"></param>
	/// <param name="addr"></param>
	/// <returns></returns>
	string ReadCombinedTotalE(string sn, string addr, string code);

	/// <summary>
	/// 读取正向有功数据块电能
	/// </summary>
	/// <param name="sn"></param>
	/// <param name="addr"></param>
	/// <returns></returns>
	string ReadPositiveAllTotal(string sn, string addr, string code);

	/// <summary>
	/// 读取正向有功总电能
	/// </summary>
	/// <param name="sn"></param>
	/// <param name="addr"></param>
	/// <returns></returns>
	string ReadPositiveTotalE(string sn, string addr, string code);

	/// <summary>
	/// 读取反向有功数据块电能
	/// </summary>
	/// <param name="sn"></param>
	/// <param name="addr"></param>
	/// <returns></returns>
	string ReadReverseAllTotal(string sn, string addr, string code);

	/// <summary>
	/// 读取反向有功总电能
	/// </summary>
	/// <param name="sn"></param>
	/// <param name="addr"></param>
	/// <returns></returns>
	string ReadReverseTotalE(string sn, string addr, string code);

	/// <summary>
	/// 电表清零
	/// </summary>
	/// <param name="sn"></param>
	/// <param name="addr"></param>
	/// <param name="code"></param>
	/// <returns></returns>
	string ClearMeter(string sn, string addr, string code);

	/// <summary>
	/// 校时
	/// </summary>
	/// <param name="sn"></param>
	/// <param name="addr"></param>
	/// <param name="code"></param>
	/// <returns></returns>
	string Timing(string sn, string addr, string code);

	/// <summary>
	/// 配置参数
	/// </summary>
	/// <param name="sn">序列号</param>
	/// <param name="addrs">地址列表</param>
	/// <param name="code">编码</param>
	/// <returns></returns>
	(bool success, string body) Configuration(string sn, List<string> addrs);
}
